07. Lab: Space Geek
Lab: Space Geek
As a preliminary exercise for building Alexa skills, we're going to use an existing Alexa template from the Alexa Skills Kit (ASK) for a fact skill named "space geek". This fact skill does nothing more than provide a random fact about space when invoked by saying "Alexa, open space geek" or "Alexa, ask space geek for a fact". Later, you will change and expand this skill for your "Alexa History Skill Project". Note that if you wish to submit a fact skill for publishing to Amazon you will need to change the facts so that they are not a duplicate of the skill provided.
As you build your app, you will define an Interaction Model consisting of words and phrases for the skill through your Amazon Developer Console and link it to a request/response server function. For this, we will use an AWS Lambda function implemented in JavaScript. Speech recognition and speech synthesis are taken care of for you by the Alexa Service.
Follow the Amazon step-by-step instructions for building the Alexa sample fact skill
The Amazon instructions for this project and the Alexa procedures change from time to time. Below is a general guide on the steps you should find there. If you have questions, please bring them up in Slack or the Forums.
1. Set up the fact skill in the Amazon Developer Portal
- Sign in or create free Amazon Developer Portal login (Note that you will only be asked to provide a credit card here if you indicate you plan to monetize your work)
- Add a new skill with Name of "My Fact Skill" and Invocation Name of "space geek". This will populate the correct starter Interaction Model.
- Review existing Intent Schema and Sample Utterances provided and save
2. Create Skill Logic in AWS Lambda
- Create an AWS Account and sign in. This will require a credit card, but the AWS Free Tier will cover your needs for this exercise and the project.
- Create an AWS Lambda Function using the alexa-skill-kit-sdk-factskill blueprint
- Configure the trigger and function per the instructions and create the function named "myFactSkill"
- Copy the ARN number for transfer back to the skill definition in the Developer portal.
3. Add your Lambda Function to your Skill
- Go back to the configuration section of the Alexa "My Fact Skill" you created in the Amazon Developer Portal
- Add the ARN number for myFactSkill
4. Test Your Skill
- Type "open space geek" in the Service Simulator in the "My Fact Skill" Service Simulator. You should see a Lambda Request and Lambda Response. By clicking the "Listen" icon, you can hear Alexa's response.
5. Customize Your Skill
- The Amazon instructions suggest TODOs to make the skill unique. We'll do more of this kind of thing in the Alexa History Skill project
6. Publish Your Skill
- Optional!